package net.googlecode.harchenko.task5.model;


import java.math.BigDecimal;

/**
 * Class represents of manager.
 */
public class Manager implements Person {

    /**
     * Unique id.
     */
    protected static int nextId = 1;


    /**
     * Salary of person.
     */
    private BigDecimal salary;

    /**
     * Person Id.
     */
    private int id;
    /**
     * First name of person.
     */
    private String firstName;

    /**
     * Last name of person.
     */
    private String lastName;

    /**
     * Age of person.
     */
    private int age;

    /**
     * Month or per-hour rate of person.
     */
    private BigDecimal rate;

    /**
     * Indicator of per hour rate.
     */
    private boolean perHour;

    /**
     * Indicator of bonus.
     */
    private boolean bonus;

    /**
     * Amount of bonus for person.
     */
    private BigDecimal bonusAmount;

    public int getAge() {
        return age;
    }                                                                                                                     //To change body of implemented methods use File | Settings | File Templates.

    public BigDecimal getSalary() {
        return salary;
    }

    public int getId() {
        return id;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public BigDecimal getRate() {
        return rate;
    }

    public void setRate(BigDecimal rate) {
        this.rate = rate;
    }

    public boolean isPerHour() {
        return perHour;
    }

    public void setPerHour(boolean perHour) {
        this.perHour = perHour;
    }

    public boolean hasBonus() {
        return bonus;
    }

    public void setBonus(boolean bonus) {
        this.bonus = bonus;
    }

    public BigDecimal getBonusAmount() {
        return bonusAmount;
    }

    public void setBonusAmount(BigDecimal bonusAmount) {
        this.bonusAmount = bonusAmount;
    }

    public Manager() {
        id = nextId;
        nextId++;
    }

    @Override
    public String toString() {
        return String.format("id %s - %s %s - Salary: %s", id, lastName, firstName, salary);
    }

    public String getType() {
        return Person.MANAGER;
    }
}